package com.retail.order.mapper;

import com.retail.order.domain.TOrder;
import com.retail.order.dto.OrderDetailResponse;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单Mapper接口
 *
 * @author retail
 * @date 2024-02-27
 */
public interface TOrderMapper
{
    /**
     * 查询订单
     *
     * @param orderId 订单主键
     * @return 订单
     */
    public TOrder selectTOrderByOrderId(Long orderId);

    /**
     * 查询订单列表
     *
     * @param tOrder 订单
     * @return 订单集合
     */
    public List<TOrder> selectTOrderList(TOrder tOrder);

    /**
     * 新增订单
     *
     * @param tOrder 订单
     * @return 结果
     */
    public int insertTOrder(TOrder tOrder);

    /**
     * 修改订单
     *
     * @param tOrder 订单
     * @return 结果
     */
    public int updateTOrder(TOrder tOrder);

    /**
     * 删除订单
     *
     * @param orderId 订单主键
     * @return 结果
     */
    public int deleteTOrderByOrderId(Long orderId);

    /**
     * 批量删除订单
     *
     * @param orderIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTOrderByOrderIds(Long[] orderIds);

    int cancelOrder(@Param("orderId") Long orderId);

    int updateRemake(TOrder tOrder);

    OrderDetailResponse selectByOderCode(String orderCode);

    TOrder updateByStatus(@Param("outTradeNo") String outTradeNo);

    List<TOrder> selectOrderMergeList(@Param("userIds") List<Integer> userIds);
}
